package com.itheima.d4_algorithm;

import java.util.Arrays;

/**
 *  目标：掌握选择排序。
 */
public class Test2 {
    public static void main(String[] args) {
        int[] ints=new int[]{1,3,5,2,4,6};
        sort(ints);
        System.out.println(Arrays.toString(ints));
    }
    public static void sort(int[] ints){
        int temp=0;
        for(int i=0;i<ints.length-1;i++){
            for(int j=i+1;j<ints.length;j++){
                if(ints[i]>ints[j]){
                    temp=ints[i];
                    ints[i]=ints[j];
                    ints[j]=temp;
                }
            }
        }
    }
}
